<?php TPL::output('admin/global/header.tpl.htm'); ?>

<!--left-->
<?php TPL::output('admin/global/left.tpl.htm'); ?>
<!--left-->

<!-- main -->
<div id="main-content">
	<div class="clear"></div>
	<div class="content-box">
		<div class="content-box-header">
			<h3>内容审核</h3>
			<ul class="content-box-tabs">
				<li><a href="admin/question/approval_list/" class="<?php if ($_GET['type'] == 'question') { ?>default-tab current<?php } ?>">站点 (<?php echo $this->question_count; ?>)</a></li>
				<li><a href="admin/question/approval_list/type-answer" class="<?php if ($_GET['type'] == 'answer') { ?>default-tab current<?php } ?>">评价 (<?php echo $this->answer_count; ?>)</a></li>
			</ul>
			<div class="clear"></div>
		</div>
		<div class="content-box-content">
			<div class="tab-content default-tab" id="tab1">				
				<?php if ($this->approval_list) { ?>
				<form id="batchs_form" action="admin/question/approval_batch/" method="post">
				<input type="hidden" id="batch_type" name="batch_type" value="approval" />
					<table class="list">
						<?php if ($_GET['type'] == 'answer') { ?>
						<thead>
							<tr>
								<th style="width:20px;"><input type="checkbox" class="check-all"></th>
								<th style="width:100px;">用户</th>
								<th>内容</th>
							</tr>
						</thead>
						<?php } else { ?>
						<thead>
							<tr>
								<th style="width:20px;"><input type="checkbox" class="check-all"></th>
								<th>用户</th>
								<th style="width:280px;">标题</th>
								<?php if (get_setting('category_enable') == 'Y') { ?>
								<th>分类</th>
								<?php } ?>
								<th>内容</th>
							</tr>
						</thead>
						<?php } ?>
						<tfoot>
							<tr>
								<td colspan="11">
									<div class="bulk-actions align-left"><a class="button" onClick="$('#batch_type').val('approval'); ajax_post($('#batchs_form'), _ajax_post_alert_processer);" href="javascript:;" id="batch_approval">通过审核</a> &nbsp; <a class="button" onClick="$('#batch_type').val('decline'); ajax_post($('#batchs_form'), _ajax_post_alert_processer);" href="javascript:;" id="batch_decline">拒绝审核</a></div>
									<div class="pagination"><?php echo $this->pagination; ?></div>
									<div class="clear"></div>
								</td>
							</tr>
						</tfoot>
						<tbody style="border-bottom: 1px solid #ddd;">
							<?php foreach ($this->approval_list AS $key => $val) { ?>
							<tr>
								<td><input type="checkbox" class="approval_ids" name="approval_ids[]" value="<?php echo $val['id']; ?>"></td>
								<td><a href="people/<?php echo $this->users_info[$val['uid']]['url_token']; ?>"><?php echo $this->users_info[$val['uid']]['user_name']; ?></a></td>
								
								<?php if ($_GET['type'] != 'answer') { ?>
								<td><a href="admin/question/approval_preview/<?php echo $val['id']; ?>" class="fancybox" data-fancybox-type="ajax"><?php echo htmlspecialchars($val['data']['question_content']); ?> <img src="<?php echo G_STATIC_URL;?>/admin/images/icons/information.png" style="vertical-align:middle" alt="" /></a></td>
								<?php if (get_setting('category_enable') == 'Y') { ?>
								<td><?php echo $this->category[$val['data']['category_id']]['title']; ?></td>
								<?php } ?>
								<?php } ?>
								
								<td><a href="admin/question/approval_preview/<?php echo $val['id']; ?>" class="fancybox" data-fancybox-type="ajax"><?php if ($_GET['type'] == 'answer') { echo cjk_substr(htmlspecialchars($val['data']['answer_content']), 0, 128, 'UTF-8', '...'); } else { echo cjk_substr(htmlspecialchars($val['data']['question_detail']), 0, 128, 'UTF-8', '...'); } ?></a></td>
							</tr>
							<?php } ?>
						</tbody>
					</table>
				</form>
				<?php } ?>
			</div>
			
	</div>

<!-- footer -->
<?php TPL::output('admin/global/footer.tpl.htm'); ?>
<!-- footer -->

</div>
<!-- main -->

</div>

</body>
</html>